package happy.coding.controller;


import happy.coding.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import happy.coding.aspect.BaseTransaction;
import happy.coding.bean.vo.BaseRespVo;
import happy.coding.bean.vo.data.HomeIndexData;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
@RequestMapping("/wx/home")
public class HomeController {
    @Autowired
    HomeService homeService;
    @ResponseBody
    @RequestMapping("/index")
    public BaseRespVo index(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        System.out.println("执行了执行了");
        HomeIndexData homeIndexData=homeService.index(null);

        return BaseRespVo.success(homeIndexData);
    }

}
